package com.springbootmybatiscurd.controller;

import com.springbootmybatiscurd.pojo.Result;
import com.springbootmybatiscurd.pojo.User;
import com.springbootmybatiscurd.service.userLoginService;
import com.springbootmybatiscurd.utils.UploadFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@CrossOrigin(origins = "*")   //设置跨域
public class controllerLogin {
@Autowired
private userLoginService userLogin;


    @PostMapping("/login")
    public Result checkUser(User u){
        Result result = userLogin.userLogin(u.getUsername(), u.getPassword());

        return result;
    }



    }

